package com.example.todaynews.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by wj on 2016/8/24.
 */
public class NewsDataHelper extends SQLiteOpenHelper {
    public static final String DATABASE_NAME = "news";
    public static final String TABLE_NAME = "todaynews";
    public static final int DATABASE_VERSION = 1;
    private static final String TAG = "NewsDataHelper";

    public NewsDataHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        Log.e(TAG, "NewsDataHelper: ");
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL("create table  todaynews (title varchar(200)," +
                "thumbnail_pic_s varchar(200)," +
                "thumbnail_pic_s02 varchar(200)," +
                "thumbnail_pic_s03 varchar(200)," +
                "date varchar(50)," +
                "realtype varchar(50)," +
                "url varchar(200))");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
